package jc16;

import jdk.management.resource.internal.inst.WrapInstrumentationRMHooks;

/*本类用于练习Thread*/
public class jincheng1 {
    public static void main(String[] args) {
        MyThread m = new MyThread();
        MyThread m1 = new MyThread();
        m.start();
        m1.start();
    }
}
class MyThread extends Thread{
    static int a1 = 100;
    Object p=new Object();
    @Override
    public void run() {
        synchronized (p){
            while (true){
                if (a1>0){
                    System.out.println(getName()+"="+a1--);
                }
                if (a1<=0)break;
            }
        }


    }
}